docs(sudoers): fix EBNF to distinguish Runas user and group lists#529
Open
pierluigilenoci wants to merge 1 commit intosudo-project:mainfrom
Open
docs(sudoers): fix EBNF to distinguish Runas user and group lists#529pierluigilenoci wants to merge 1 commit intosudo-project:mainfrom
pierluigilenoci wants to merge 1 commit intosudo-project:mainfrom
Conversation
The Runas_Spec grammar used a single Runas_List for both the user and group portions, but the sudoers parser does not accept %-prefixed groups (e.g., %group, %#gid, %:nonunix_group, %:#nonunix_gid) in the group position after the colon. Split Runas_List/Runas_Member into: - Runas_User_List/Runas_User: the full set of members (user names, UIDs, %group, %#gid, %:nonunix_group, %:#nonunix_gid, +netgroup, Runas_Alias, ALL) - Runas_Group_List/Runas_Group: only group names, #group-ID, +netgroup, Runas_Alias, and ALL Update the Runas_Spec rule, Runas_Alias_Spec, Defaults> syntax, and the surrounding prose to use the new type names. Fixes: sudo-project#520 Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #520 — The EBNF grammar for
Runas_Specused a singleRunas_Listfor both the user and group portions, but the sudoers parser does not accept%-prefixed groups (e.g.,%group,%#gid,%:nonunix_group,%:#nonunix_gid) in the group position (after the colon).As @millert noted in #520 (comment):
This patch does exactly that — it splits the EBNF definitions into separate types:
Runas_User_List/Runas_User: retains the full set of members (user names, UIDs,%group,%#gid,%:nonunix_group,%:#nonunix_gid,+netgroup,Runas_Alias,ALL)Runas_Group_List/Runas_Group: onlygroup name,#group-ID,+netgroup,Runas_Alias, andALLChanges in
docs/sudoers.mdoc.inRunas_List/Runas_MemberwithRunas_User_List/Runas_UserandRunas_Group_List/Runas_GroupRunas_Specrule to use the new typesRunas_Alias_SpecandDefaults>syntax to referenceRunas_User_ListNote
This PR was generated with the assistance of AI tooling, with human review and validation.